/**
 * 
 */
package client;

import java.util.*;

import paintservice.IPaintService;
import pojo.Message;

import org.codehaus.xfire.XFireFactory;
import org.codehaus.xfire.client.XFireProxyFactory;
import org.codehaus.xfire.service.*;
import org.codehaus.xfire.service.binding.*;

import java.net.MalformedURLException;

/**
 * @author peter
 * @date   2010-5-7
 */
public class PaintClient {

	IPaintService srvc;
	
	public PaintClient()
	{
		Service srvcModel= new ObjectServiceFactory().create(IPaintService.class);
		XFireProxyFactory factory=new XFireProxyFactory(XFireFactory.newInstance().getXFire());
		
		String userURL="http://localhost:8080/ToolService/services/PaintService";
		
		try{
			srvc=(IPaintService)factory.create(srvcModel,userURL);		
			
		}catch(MalformedURLException e)
		{
			e.printStackTrace();
		}
	}
	public Vector<Message>  getGraphMessage(String username)
	{
		
		return srvc.getGraphMessage(username);
	}
	public void graphMessage(Message message)
	{
		srvc.graphMessage(message);
	}
}
